/*
 * @Author: 星孑
 * @Date: 2022-03-10 15:24:22
 * @LastEditors: 星孑
 * @LastEditTime: 2022-04-12 16:21:28
 * @FilePath: /vue-template-web/src/main.js
 * @Description:
 */
import Vue from 'vue'
import App from './App.vue'

import './style/index.scss'
import router from './router'
import store from './store'
import './permission' // permission control
import './components'

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'

Vue.use(ElementUI, { size: 'small' })
Vue.directive('permission', {
  bind: function(el, binding) {
    el.style.display = store.getters.buttons.find(item => item.code === binding.value) ? 'inline-block' : 'none'
  },
  update: function(el, binding) {
    el.style.display = store.getters.buttons.find(item => item.code === binding.value) ? 'inline-block' : 'none'
  }
})
Vue.config.productionTip = false

new Vue({
  render: h => h(App),
  router,
  store
}).$mount('#app')
